namespace ChumChase.Model
{
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Linq;

    public class FeedCollection
    {
        private readonly FeedView _homeFeed = new FeedView();
        private readonly ObservableCollection<FeedView> _views = new ObservableCollection<FeedView>();

        public FeedView HomeFeed
        {
            get { return _homeFeed; }
        }

        public IList<FeedView> Views
        {
            get { return _views; }
        }

        public FeedView GetFeedById(string id)
        {
            if (id == "home") return HomeFeed;

            IEnumerable<FeedView> q = from feed in Views
                                      where feed.Id == id
                                      select feed;

            return q.FirstOrDefault();
        }
    }
}